Skip to content

Support stylish-haskell with ghc9.0 #2820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

July541
Copy link
Collaborator

@July541 July541 commented Apr 10, 2022

I have a fork that include stylish-haskell compile with ghc 9.0 https://github.com/July541/stylish-haskell/tree/ghc-9.0, and this pr uses the fork directly.

CI looks well https://github.com/July541/stylish-haskell/actions/runs/2142857127

Copy link
Member

@Ailrun Ailrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@Ailrun
Copy link
Member

Ailrun commented Apr 10, 2022

How hard will it be to make your patch compatible with the current stylish-haskell head (which supports ghc 9.2)? If it's not so hard, could you also send a PR there?

@July541
Copy link
Collaborator Author

July541 commented Apr 10, 2022

How hard will it be to make your patch compatible with the current stylish-haskell head (which supports ghc 9.2)? If it's not so hard, could you also send a PR there?

Not easy, I developed based on v0.13.0.0, which has a bunch of different representations, current head has a clean structure with ghc9.2. I'd prefer someone can send this fork to hackage directly and this fork should exist as a branch in haskell/stylish-haskell, because it's just a compat that only works for HLS(Others will choose v0.14 ideally)

@pepeiborra
Copy link
Collaborator

pepeiborra commented Apr 10, 2022

Let's take a step back:

  • Stylish-haskell uses ghc-lib so it's not directly coupled to the ghc version. Concretely, stylish-haskell-0.13 uses ghc-lib-parser-8.10 and stylish-haskell-0.14 uses ghc-lib-parser-9.2
  • Moreover, other HLS plugins also have ghc-lib-parser requirements. Concretely, hlint-3.3.6 requires ghc-lib-9.0 and hlint-3.2.8 requires ghc-lib-parser-8.10.
  • ghc-lib-parser versions have ghc requirements themselves. From the project readme:
Ghc flavor >= version < version
ghc-8.8.* 8.4.4 8.10.1
ghc-8.10.* 8.6.5 9.0.1
ghc-9.0.1 8.8.1 9.2.1
ghc-9.2.1 8.10.1

What this means for HLS

  • ghc 8.10.7 We can fallback to hlint-3.2.8 and stylish-haskell-0.13 which both accept ghc-lib-parser-8.10.7
  • ghc 9.0 Since ghc-lib-parser-8.10.7 doesn't build with ghc 9.0, we cannot use hlint-3.2.8 nor stylish-haskell-0.13 anymore. We have to choose between hlint-3.3.6 and stylish-haskell-0.14
  • ghc 9.2 Since ghc-lib-parser-9.0 doesn't build with ghc 9.2, we cannot use hlint-3.3.6. But stylish-haskell-0.14 is fine.

The future-proof and non-forky thing to do here is to evolve hlint to support ghc 9.2. Once that's available, we can link both stylish-haskell and hlint in all the ghc versions from 8.10.7.

@pepeiborra
Copy link
Collaborator

That said, I am not against merging this PR, as it doesn't make anything worse and it means that we can distribute 9.0 binaries which support both plugins.

@pepeiborra
Copy link
Collaborator

Relevant hlint issue: ndmitchell/hlint#1359

@July541
Copy link
Collaborator Author

July541 commented Apr 11, 2022

It's worth closing this and waiting for hlint support before the next hls release.

@July541 July541 closed this Apr 11, 2022
@July541 July541 mentioned this pull request Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants